package net.ericaro.neojavagen.blocks ;
import net.ericaro.neojavagen.blocks.ForStatement;
import net.ericaro.neojavagen.expressions.Expression;
import net.ericaro.neojavagen.blocks.ForUpdate;
import net.ericaro.neojavagen.blocks.ForInit;
import net.ericaro.neojavagen.blocks.Statement ;

/**
* *<pre> BasicForStatement :
    for ( ForInit? ; Expression? ; ForUpdate? ) Statement
</pre>
*/
public class BasicForStatement  implements ForStatement {

ForInit forinit;
Expression expression;
ForUpdate forupdate;
Statement statement ;

public BasicForStatement( ForInit forinit, Expression expression, ForUpdate forupdate, Statement statement ){
	this.forinit = forinit; this.expression = expression; this.forupdate = forupdate; this.statement = statement ;
	}public BasicForStatement( Statement statement ){
this.statement = statement ;
}


public String toString(){
	StringBuilder stringbuilder = new StringBuilder();
	stringbuilder.append( "for" ).append(" ");
stringbuilder.append( "(" ).append(" ");
if (this.forinit !=null ) stringbuilder.append( this.forinit ).append(" ");
stringbuilder.append( ";\n" ).append(" ");
if (this.expression !=null ) stringbuilder.append( this.expression ).append(" ");
stringbuilder.append( ";\n" ).append(" ");
if (this.forupdate !=null ) stringbuilder.append( this.forupdate ).append(" ");
stringbuilder.append( ")" ).append(" ");
stringbuilder.append( this.statement ).append(" ") ;
	return stringbuilder.toString();
}

}
